var common = require('./common.js').default;
var api = new function() {
    this.setConfig = function(config) {
        this.config = config;
        var baseUrl = config.base_url;
        this.version = "1.0.3";
        if(process.env.NODE_ENV == "dev"){
             baseUrl= "/huzhou_api";
        }

        this.getQRCode = baseUrl + "/user/getQRCode" //获取小程序二维码
        this.zhifubaotradeNo = baseUrl + "/pay/zhifubao/{tradeNo}" //支付宝发起支付
        this.register = baseUrl + "/user/register/{telephone}/{identity}"; //个人注册
        this.login = baseUrl + "/user/login/{telephone}"; //个人登录
        this.base64PngUpload = baseUrl + "/upload/base64Png"; //个人注册上传图片
        this.getNewToken = baseUrl + "/user/getNewToken"; //获取新的token

        this.companyRegister = baseUrl + "/company/register"; //企业注册
        this.companyRegisterUpload = baseUrl + "/huzhou/file/upload"; //企业注册

        this.companyLogin = baseUrl + "/company/login/{telephone}"; //企业登录
        this.verifyCode = baseUrl + "/verifycode/zpk9WynKKfqCAjGtTMObk2vycXkpv67B.jpg"; //登录获取验证码

        this.getProjects = baseUrl + "/index/getProjects"; //获取首页报名字段
        this.getNewsList = baseUrl + "/news/getNewsList/{newsType}"; //获取新闻
        this.getNews = baseUrl + "/news/getNews/{id}"; //获取新闻内容

        this.getVerifyCodeForget = baseUrl + "/verifycode/getVerifyCodeForget/{telephone}";
        this.getVerifyCodeRegister = baseUrl + "/verifycode/getVerifyCodeRegister/{telephone}";
        this.getVerifyCodeUpdatePwd = baseUrl + "/verifycode/getVerifyCodeUpdatePwd";

        this.resetPwd = baseUrl + "/user/resetPwd/{telephone}";

        this.companyResetPwd = baseUrl + "/company/resetPwd/{telephone}";

        this.lookCertificate = baseUrl + "/certificate/{applyid}"; //查看证书

        this.getType = baseUrl + "/type/getType/{projectCode}"; //获取专业list

        this.searchPersonCertificate = baseUrl + "/certificate/searchPersonCertificate/{identity}";
        this.searchCompanyCertificate = baseUrl + "/certificate/searchCompanyCertificate";

        this.applyForRefund = baseUrl + "/refund/applyForRefund/{tradeNo}";
        this.flow_order = baseUrl + "/pay/flow_order/{tradeNo}";
        this.getInvoiceInfo = baseUrl + "/invoice/getInvoiceInfo/{tradeNo}"; //发票信息

        this.confirm_order = baseUrl + "/pay/confirm_order/{kid}/{tradeNo}"; //确认订单并开票

        // 继续教育专业技术人员个人报名
        this.getCombApply = baseUrl + "/jxjyApply/getCombApply" //专业技术人员个人报名
        this.launchZjApplyTrade = baseUrl + "/jxjyApply/launchZjApplyTrade/{invoiceTempId}" //专业技术人员个人报名
        this.launchTzgApplyTrade = baseUrl + "/jxjyApply/launchTzgApplyTrade/{invoiceTempId}" //tzg个人报名

        // 继续教育特种工个人报名
        this.getCertificates = baseUrl + "/certificate/getCertificates/{identityCode}" //特种工报名获取证书
        this.getTzgProductPrice = baseUrl + "/jxjyApply/getTzgProduct"

        /* 获取视频 */
        this.getDetail = baseUrl + "/course/getDetail/{courseId}";
        this.saveVideoPlayRecord = baseUrl +
            "/play/saveVideoPlayRecord/{vid}/{courseId}/{rid}/{playTime}"; //提交视频进度
        this.saveVideoFinish = baseUrl + "/play/saveVideoFinish/{vid}/{cid}/{rid}"; //提交视频

        //获取习题
        // this.lunchQuestion = baseUrl + "/question/lunchQuestion/{questionId}"; //获取试题
        this.saveQuestionItem = baseUrl + "/question/save/{rid}/{itemid}"; //提交每一题
        this.getQuestionRecord = baseUrl + "/question/getQuestionRecord/{rid}"; //获取进度
        this.getQuestionJson = baseUrl + "/question/getQuestionJson/{qid}"; //获取试题json
        this.questionSubmit = baseUrl + "/question/questionSubmit/{rid}"; //重置习题
        this.getTrueQuestionJson = baseUrl + "/question/getTrueQuestionJson"
        this.submitRecord = baseUrl + "/question/submitRecord/{studyTaskUserId}" // 提交试卷
        this.addRecord = baseUrl + "/question/addStudySubmitRecordNew/{studyTaskUserId}" // 提交试卷
        // this.addRecord = baseUrl + "/question/addRecord" // recordNo  ， tradeNo
        this.getPlayAuth = baseUrl + "/course/getPlayAuth"; //获取video列表  aliId

        //开发票
        this.saveInvoiceTemp = baseUrl + "/invoice/saveInvoiceTemp" //发票新增保存
        this.delInvoiceTemp = baseUrl + "/invoice/delInvoiceTemp/{id}" //发票删除
        this.getInvoiceTemp = baseUrl + "/invoice/getInvoiceTemp" //发票获取list
        this.getInvoiceTempById = baseUrl + "/invoice/getInvoiceTempById/{id}" //获取单个发票
        // this.comfirmTrade = baseUrl + "/pay/comfirmTrade/{tradeNo}/{invoiceTempId}" //发票确认订单
        this.updateInvoiceInfo = baseUrl +
            "/tzgExamApply/updateTradeInvoice/{tradeNo}/{invoiceTemplateId}" //修改发票 tradeType  1继续教育3三类4特种工

        //三类考试报名
        this.getProducts = baseUrl + "/product/getProducts";
        this.getProductUrl = baseUrl + "/product/getProductUrl";
        this.slryExamApplyPay = baseUrl + "/slryExamApply/launchApply/{productCode}/{invoiceTempId}" //三类考试报名去付款
        this.getPersonApplyForm = baseUrl + "/tzgExamApply/getPersonApplyForm/{tradeNo}" //特种工获取报名表

        /* 特种工个人报名 */

        this.uploadPortraitUrl = baseUrl + "/user/uploadPortraitUrl" //特种作业持证人员个人考试报名上传头像

        this.tzgExamApply = baseUrl + "/tzgExamApply/launchApply/{invoiceTempId}" //特种作业持证人员考试报名
        // 个人中心
        this.isCompleteUserInfo = baseUrl + "/user/isCompleteUserInfo"; //判断是否补全信息（身份证、头像）
        this.feedback = baseUrl + "/user/feedback/{code}"; //意见反馈
        this.getMyInfo = baseUrl + "/user/getMyInfo"; //获取个人信息
        this.delApply = baseUrl + "/jxjyApply/delApply/{tradeNo}"; //删除报名信息
        this.getApplyInfo = baseUrl + "/user/getApplyInfo"; //获取我的报名信息
        this.resetPsersonPwd = baseUrl + "/user/resetPsersonPwd"; //修改密码
        this.changeTelephone = baseUrl + "/user/changeTelephone"; //更换手机号
        this.applyChangeCompany = baseUrl + "/user/applyChangeCompany"; // 修改企业
        this.getMyCertificate = baseUrl + "/certificate/getMyCertificate"; //个人中心获取证书list
        this.getVerifyCodeFeedBack = baseUrl + "/verifycode/getVerifyCodeFeedBack"; //意见反馈获取手机号
        this.getVerifyCodeChangeTelephone = baseUrl +
            "/verifycode/getVerifyCodeChangeTelephone/{telephone}"; //更换手机号验证码
        this.getMyAdmissionTheoryTicket = baseUrl +
            "/tzgExamApply/getMyAdmissionTheoryTicket/{tradeNo}"; //特种工查看理论准考证
        this.getMyAdmissionPracticalTicket = baseUrl +
            "/tzgExamApply/getMyAdmissionPracticalTicket/{tradeNo}"; //特种工查看实操准考证

        this.getMyAdmissionSlryTicket = baseUrl +
            "/slryExamApply/getMyAdmissionSlryTicket/{tradeNo}"; //三类人员查看准考证

        //任务界面
        this.getMyApplySuccess = baseUrl + "/jxjyApply/getMyApplySuccess"; //继续教育获取专业
        this.slryGetMyApplySuccess = baseUrl + "/slryExamApply/getMyApplySuccess"; //三类任务界面获取专业
        this.getCourses = baseUrl + "/course/getCourses/{applyId}"; //获取课时
        this.chooseCourse = baseUrl + "/course/chooseCourse/{applyId}/{tradeNo}"; //获取课时后确定
        this.getTasks = baseUrl + "/task/getTasks/{productId}/{tradeNo}/{classType}"; //获取任务列表.

        //三类补考

        this.getSlryResitList = baseUrl + "/slryExamResit/getResitList";
        this.slryapplyById = baseUrl + "/slryExamResit/apply/{id}";

        //特种工补考
        this.getResitList = baseUrl + "/tzgExamResit/getResitList";
        this.tzgResitApply = baseUrl + "/tzgExamResit/apply/{id}";

        //建筑施工三类特种工提升教育
        this.launchJzsgApplyTrade = baseUrl + "/jxjyApply/launchJzsgApplyTrade/{invoiceTempId}"

        this.getEmailList = baseUrl + "/email/getEmailList";
        this.applyChangeList = baseUrl + "/user/applyChangeList";
        this.deleteChangeInfo = baseUrl + "/user/deleteChangeInfo/{transactionNo}";


        //二建继续教育
        this.getType = baseUrl + "/type/getType/{projectCode}";
        this.launchEjApplyTrade = baseUrl + "/jxjyApply/launchEjApplyTrade/{invoiceTempId}";


        this.getProducts = baseUrl + "/product/getProducts";
        this.getProductUrl = baseUrl + "/product/getProductUrl";
        this.getConfig = baseUrl + "/rpcConfig/getConfig"; //配置 configKey
    }
}

module.exports = api
